<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta content="no-cache, no-store, must-revalidate" http-equiv="Cache-Control"/>
    <meta content="no-cache" http-equiv="Pragma"/>
    <meta content="0" http-equiv="Expires"/>
    <link rel="stylesheet" href="../styles/base.css"/>
    <link rel="stylesheet" href="../styles/common.css"/>
    <link rel="stylesheet" href="../styles/font/iconfont.css"/>
    <link rel="stylesheet" href="../styles/pages/tabs.css"/>
    <link rel="stylesheet" href="../jqueryNicepage/css/layui.css"  media="all">
    <style>
        body{
            background:#ddecf5;
        }
        #loading{
            left:50%;
            top:150px;
        }
        tbody tr th:last-child,thead tr th:last-child{
            display:none
        }
        .operationIcon,.submitMes{
            display:none
        }
        .tabList{
            display: none;
        }
        .historyType{
            display: block;
        }
        body{
            background:#ddecf5;
            overflow: hidden;
        }
        #loading{
            left:50%;
            top:150px;
        }
        .rightHeader{
            width:98.46%;
        }
        .tab{
            overflow: hidden;position: absolute;
        }
        .rightTable1{
            margin-top:0px;
            height:40px;
        }
        .tab{
            overflow: hidden;position: absolute;
        }
        .table_tbody_box{
            height: 440px;
            overflow-y: scroll;
        }
        .table_tbody_box tr{
            height:37px;
        }
    </style>
</head>
<body>
<div class="boxContainer">
    <div id="loading">
        <img src='../styles/img/loading.gif' />
    </div>
    <div class="leftSide commonSide" id="leftSide">
        <ul class="tabBox">
            <li class="tabList tabListChecked" data-title="side1" data-type="ADDPart"><i class="iconfont">&#xe62c;</i><span class="fontStyle">新增物料</span></li>
            <li class="tabList" data-title="side2" data-type="DelPart"><i class="iconfont">&#xe635;</i><span class="fontStyle">删除物料</span></li>
            <li class="tabList" data-title="side3" data-type="ReplacePart"><i class="iconfont">&#xe615;</i><span class="fontStyle">替换物料</span></li>
            <li class="tabList" data-title="side4" data-type="UpdatePart"><i class="iconfont">&#xe606;</i><span class="fontStyle">用量修改</span></li>
            <li class="tabList" data-title="side5" data-type="ADDReplcePart"><i class="iconfont">&#xe61d;</i><span class="fontStyle">新增替代料</span></li>
            <li class="tabList" data-title="side6" data-type="DelReplcePart"><i class="iconfont">&#xe676;</i><span class="fontStyle">删除替代料</span></li>
            <li class="tabList" data-title="side7" data-type="UpdateReplcePart"><i class="iconfont">&#xe68b;</i><span class="fontStyle">更换替代料</span></li>
            <li class="tabList" data-title="side8" data-type="updateAPart"><i class="iconfont">&#xe63e;</i><span class="fontStyle">更换主料</span></li>
            <li class="tabList" data-title="side9" data-type="ReplaceABPart"><i class="iconfont">&#xe602;</i><span class="fontStyle">主次替换</span></li>
			<!-- add by xucr on 20210126 添加替代料用量修改 -->
			<li class="tabList" data-title="side10" data-type="UpdateSubstitutesQuantity"><i class="iconfont">&#xe602;</i><span class="fontStyle">替料用量修改</span></li>
		</ul>
    </div>
    <div class="rightForm commonSide" id="rightForm">
        <div class="bgClassBox">
            <div class="tab side1 tabClass">
                <div class="rightFormBtn"><div class="toExcell" >导出Excel</div><div class="closePage">关闭</div><div class="submitMes">提交</div></div>
                <table  cellspacing="0" cellpadding="0" id="" class="rightHeader ecoTabsTable" style="border-width:1px;border-style:solid;border-color:#ccc"  border="1">
                    <thead class="tableHeader">
                    <tr>
                        <th>序号</th>
                        <th>新增料号</th>
                        <th>状态</th>
                        <th>用量</th>
                        <th>单位</th>
                        <th>受影响对象</th>
                        <th>编辑</th>
                    </tr>
                    </thead>
                </table>
                <div class="table_tbody_box">
                    <table cellspacing="0" cellpadding="0" id="side1" class="rightTable1  ecoTabsTable" style="border-width:1px;border-style:solid;border-color:#ccc"  border="1">
                        <tbody >
                        <tr>
                            <td class="tabNum serialNum">1</td>
                            <td><input type="text"/></td>
                            <td><input type="text"/></td>
                            <td><input type="text"/></td>
                            <td><input type="text"/></td>
                            <td><input type="text" placeholder=""/></td>
                            <td class="operationIcon"><i title="搜索" class="searchPage iconfont">&#xe683;</i><i title="删除" class="iconfont deleteItem">&#xe6ee;</i><i title="增加一行" class="iconfont addCuloumn">&#xe601;</i></td>
                        </tr>
                        </tbody>
                    </table></div>

            </div>
            <div class="tab side2">
                <div class="rightFormBtn"><div class="toExcell" >导出Excel</div><div class="closePage">关闭</div><div class="submitMes">提交</div></div>
                <table cellspacing="0" cellpadding="0" class="rightHeader ecoTabsTable" style="border-width:1px;border-style:solid;border-color:#ccc;margin-top: 50px"  border="1">
                    <thead>
                    <tr>
                        <th>序号</th>
                        <th>删除料号</th>
                        <th>状态</th>
                        <th>用量</th>
                        <th>单位</th>
                        <th>行号</th>
                        <th>受影响对象</th>
                        <th>编辑</th>
                    </tr>

                    </thead></table>
                <div class="table_tbody_box">
                    <table cellspacing="0" cellpadding="0" id="side2" class="rightTable1 ecoTabsTable" style="border-width:1px;border-style:solid;border-color:#ccc;margin-top: 0"  border="1">
                        <tbody >
                        <tr>
                            <td class="tabNum serialNum">1</td>
                            <td><input type="text"/></td>
                            <td><input type="text"/></td>
                            <td><input type="text"/></td>
                            <td><input type="text"/></td>
                            <td><input type="text"/></td>
                            <td><input id="inputItem" type="text" placeholder=""/></td>
                            <td class="operationIcon"><i title="搜索" class="searchPage iconfont">&#xe683;</i><i title="删除" class="iconfont deleteItem">&#xe6ee;</i><i title="增加一行" class="iconfont addCuloumn">&#xe601;</i></td>
                        </tr>
                        </tbody>
                    </table></div>
            </div>
            <div class="tab side3">
                <div class="rightFormBtn"><div class="toExcell" >导出Excel</div><div class="closePage">关闭</div><div class="submitMes">提交</div></div>
                <table cellspacing="0" cellpadding="0" id="rightHeader3" class="rightHeader ecoTabsTable" style="border-width:1px;border-style:solid;border-color:#ccc;margin-top: 50px"  border="1">
                    <thead>
                    <tr>
                        <th>序号</th>
                        <th>原料号</th>
                        <th>状态</th>
                        <th>原料号用量</th>
                        <th>单位</th>
                        <th>行号</th>
                        <th>新料号</th>
                        <th>状态</th>
                        <th>新料号用量</th>
                        <th>单位</th>
                        <th>变更后行号</th>
                        <th>受影响对象</th>
                        <th>编辑</th>
                    </tr>

                    </thead></table>
                <div class="table_tbody_box">
                    <table cellspacing="0" cellpadding="0" id="side3" class="rightTable1 ecoTabsTable" style="border-width:1px;border-style:solid;border-color:#ccc"  border="1">
                        <tbody >
                        <tr>
                            <td class="tabNum serialNum">1</td>
                            <td><input type="text"/></td>
                            <td><input type="text"/></td>
                            <td><input type="text"/></td>
                            <td><input type="text"/></td>
                            <td><input type="text"/></td>
                            <td><input type="text"/></td>
                            <td><input type="text"/></td>
                            <td><input type="text"/></td>
                            <td><input type="text"/></td>
                            <td><input type="text"/></td>
                            <td><input type="text" placeholder=""/></td>
                            <td class="operationIcon"><i title="搜索" class="searchPage iconfont">&#xe683;</i><i title="删除" class="iconfont deleteItem">&#xe6ee;</i><i title="增加一行" class="iconfont addCuloumn">&#xe601;</i></td>
                        </tr>
                        </tbody>
                    </table></div>
            </div>
            <div class="tab side4">
                <div class="rightFormBtn"><div class="toExcell" >导出Excel</div><div class="closePage">关闭</div><div class="submitMes">提交</div></div>
                <table cellspacing="0" cellpadding="0" id="rightHeader4" class="rightHeader ecoTabsTable" style="border-width:1px;border-style:solid;border-color:#ccc;margin-top: 50px"  border="1">
                    <thead>
                    <tr>
                        <th>序号</th>
                        <th>变更料号</th>
                        <th>状态</th>
                        <th>变更前用量</th>
                        <th>单位</th>
                        <th>行号</th>
                        <th>变更后用量</th>
                        <th>单位</th>
                        <th>受影响对象</th>
                        <th>编辑</th>
                    </tr>
                    </thead></table>
                <div class="table_tbody_box">
                    <table  cellspacing="0" cellpadding="0" id="side4" class="rightTable1 ecoTabsTable" style="border-width:1px;border-style:solid;border-color:#ccc" border="1">

                        <tbody >
                        <tr>
                            <td class="tabNum serialNum">1</td>
                            <td><input type="text"/></td>
                            <td><input type="text"/></td>
                            <td><input type="text"/></td>
                            <td><input type="text"/></td>
                            <td><input type="text"/></td>
                            <td><input type="text"/></td>
                            <td><input type="text"/></td>
                            <td><input type="text" placeholder=""/></td>
                            <td class="operationIcon"><i title="搜索" class="searchPage iconfont">&#xe683;</i><i title="删除" class="iconfont deleteItem">&#xe6ee;</i><i title="增加一行" class="iconfont addCuloumn">&#xe601;</i></td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
            <div class="tab side5">
                <div class="rightFormBtn"><div class="toExcell" >导出Excel</div><div class="closePage">关闭</div><div class="submitMes">提交</div></div>
                <table cellspacing="0" cellpadding="0" id="rightHeader5" class="rightHeader ecoTabsTable" style="border-width:1px;border-style:solid;border-color:#ccc;margin-top: 50px"  border="1">
                    <thead>
                    <tr>
                        <th>序号</th>
                        <th>主料号</th>
                        <th>状态</th>
                        <th>行号</th>
                        <th>新增代替料料号</th>
                        <th>状态</th>
                        <th>新增代替料用量</th>
                        <th>单位</th>
                        <th>受影响对象</th>
                        <th>编辑</th>
                    </tr>
                    </thead></table>
                <div class="table_tbody_box">
                    <table  cellspacing="0" cellpadding="0" id="side5" class="rightTable1 ecoTabsTable" style="border-width:1px;border-style:solid;border-color:#ccc"  border="1">
                        <tbody >
                        <tr>
                            <td class="tabNum serialNum">1</td>
                            <td><input type="text"/></td>
                            <td><input type="text"/></td>
                            <td><input type="text"/></td>
                            <td><input type="text"/></td>
                            <td><input type="text"/></td>
                            <td><input type="text"/></td>
                            <td><input type="text"/></td>
                            <td><input type="text" placeholder=""/></td>
                            <td class="operationIcon"><i title="搜索" class="searchPage iconfont">&#xe683;</i><i title="删除" class="iconfont deleteItem">&#xe6ee;</i><i title="增加一行" class="iconfont addCuloumn">&#xe601;</i></td>
                        </tr>
                        </tbody>
                    </table></div>
            </div>
            <div class="tab side6">
                <div class="rightFormBtn"><div class="toExcell" >导出Excel</div><div class="closePage">关闭</div><div class="submitMes">提交</div></div>
                <table cellspacing="0" cellpadding="0" id="rightHeader6" class="rightHeader ecoTabsTable" style="border-width:1px;border-style:solid;border-color:#ccc;margin-top: 50px"  border="1">
                    <thead>
                    <tr>
                        <th>序号</th>
                        <th>主料号</th>
                        <th>状态</th>
                        <th>行号</th>
                        <th>删除替代料料号</th>
                        <th>状态</th>
                        <th>受影响对象</th>
                        <th>编辑</th>
                    </tr>
                    </thead></table>
                <div class="table_tbody_box">
                    <table  cellspacing="0" cellpadding="0" id="side6" class="rightTable1 ecoTabsTable" style="border-width:1px;border-style:solid;border-color:#ccc"  border="1">

                        <tbody >
                        <tr>
                            <td class="tabNum serialNum">1</td>
                            <td><input type="text"/></td>
                            <td><input type="text"/></td>
                            <td><input type="text"/></td>
                            <td><input type="text"/></td>
                            <td><input type="text"/></td>
                            <td><input type="text" placeholder=""/></td>
                            <td class="operationIcon"><i title="搜索" class="searchPage iconfont">&#xe683;</i><i title="删除" class="iconfont deleteItem">&#xe6ee;</i><i title="增加一行" class="iconfont addCuloumn">&#xe601;</i></td>
                        </tr>
                        </tbody>
                    </table></div>
            </div>
            <div class="tab side7">
                <div class="rightFormBtn"><div class="toExcell" >导出Excel</div><div class="closePage">关闭</div><div class="submitMes">提交</div></div>
                <table cellspacing="0" cellpadding="0" id="rightHeader7" class="rightHeader ecoTabsTable" style="border-width:1px;border-style:solid;border-color:#ccc;margin-top: 50px"  border="1">
                    <thead>
                    <tr>
                        <th>序号</th>
                        <th>主料号</th>
                        <th>状态</th>
                        <th>行号</th>
                        <th>原替代料料号</th>
                        <th>状态</th>
                        <th>变更前用量</th>
                        <th>单位</th>
                        <th>新替代料料号</th>
                        <th>状态</th>
                        <th>变更后用量</th>
                        <th>单位</th>
                        <th>受影响对象</th>
                        <th>编辑</th>
                    </tr>
                    </thead></table>
                <div class="table_tbody_box">
                    <table  cellspacing="0" cellpadding="0" id="side7" class="rightTable1 ecoTabsTable" style="border-width:1px;border-style:solid;border-color:#ccc"  border="1">
                        <tbody >
                        <tr>
                            <td class="tabNum serialNum">1</td>
                            <td><input type="text"/></td>
                            <td><input type="text"/></td>
                            <td><input type="text"/></td>
                            <td><input type="text"/></td>
                            <td><input type="text"/></td>
                            <td><input type="text"/></td>
                            <td><input type="text"/></td>
                            <td><input type="text"/></td>
                            <td><input type="text"/></td>
                            <td><input type="text"/></td>
                            <td><input type="text"/></td>
                            <td><input type="text" placeholder=""/></td>
                            <td class="operationIcon"><i title="搜索" class="searchPage iconfont">&#xe683;</i><i title="删除" class="iconfont deleteItem">&#xe6ee;</i><i title="增加一行" class="iconfont addCuloumn">&#xe601;</i></td>
                        </tr>
                        </tbody>
                    </table></div>
            </div>
            <div class="tab side8">
                <div class="rightFormBtn"><div class="toExcell" >导出Excel</div><div class="closePage">关闭</div><div class="submitMes">提交</div></div>
                <table cellspacing="0" cellpadding="0" id="rightHeader8" class="rightHeader ecoTabsTable" style="border-width:1px;border-style:solid;border-color:#ccc;margin-top: 50px"  border="1">
                    <thead>
                    <tr>
                        <th>序号</th>
                        <th>原主料料号</th>
                        <th>状态</th>
                        <th>行号</th>
                        <th>变更前用量</th>
                        <th>单位</th>
                        <th>新主料料号</th>
                        <th>状态</th>
                        <th>变更后用量</th>
                        <th>单位</th>
                        <th>受影响对象</th>
                        <th>编辑</th>
                    </tr>
                    </thead></table>
                <div class="table_tbody_box">
                    <table  cellspacing="0" cellpadding="0" id="side8" class="rightTable1 ecoTabsTable" style="border-width:1px;border-style:solid;border-color:#ccc"  border="1">

                        <tbody >
                        <tr>
                            <td class="tabNum serialNum">1</td>
                            <td><input type="text"/></td>
                            <td><input type="text"/></td>
                            <td><input type="text"/></td>
                            <td><input type="text"/></td>
                            <td><input type="text"/></td>
                            <td><input type="text"/></td>
                            <td><input type="text"/></td>
                            <td><input type="text"/></td>
                            <td><input type="text"/></td>
                            <td><input type="text" placeholder=""/></td>
                            <td class="operationIcon"><i title="搜索" class="searchPage iconfont">&#xe683;</i><i title="删除" class="iconfont deleteItem">&#xe6ee;</i><i title="增加一行" class="iconfont addCuloumn">&#xe601;</i></td>
                        </tr>
                        </tbody>
                    </table></div>
            </div>
            <div class="tab side9">
                <div class="rightFormBtn"><div class="toExcell" >导出Excel</div><div class="closePage">关闭</div><div class="submitMes">提交</div></div>
                <table cellspacing="0" cellpadding="0" id="rightHeader9" class="rightHeader ecoTabsTable" style="border-width:1px;border-style:solid;border-color:#ccc;margin-top: 50px"  border="1">
                    <thead>
                    <tr>
                        <th>序号</th>
                        <th>原主料料号</th>
                        <th>状态</th>
                        <th>原主料行号</th>
                        <th>原代替料料号</th>
                        <th>状态</th>
                        <th>受影响对象</th>
                        <th>编辑</th>
                    </tr>
                    </thead></table>
                <div class="table_tbody_box">
                    <table  cellspacing="0" id="side9" cellpadding="0" class="rightTable1 ecoTabsTable" style="border-width:1px;border-style:solid;border-color:#ccc"  border="1">

                        <tbody >
                        <tr>
                            <td class="tabNum serialNum">1</td>
                            <td><input type="text"/></td>
                            <td><input type="text"/></td>
                            <td><input type="number"/></td>
                            <td><input type="text"/></td>
                            <td><input type="text"/></td>
                            <td><input type="text" placeholder=""/></td>
                            <td class="operationIcon"><i title="搜索" class="searchPage iconfont">&#xe683;</i><i title="删除" class="iconfont deleteItem">&#xe6ee;</i><i title="增加一行" class="iconfont addCuloumn">&#xe601;</i></td>
                        </tr>
                        </tbody>
                    </table></div>
            </div>
			<!-- add by xucr on 20210126 添加替代料用量修改 begin -->
            <div class="tab side10">
                <div class="rightFormBtn"><div class="toExcell" >导出Excel</div><div class="closePage">关闭</div><div class="submitMes">提交</div></div>
				<table cellspacing="0" cellpadding="0" id="rightHeader10" class="rightHeader ecoTabsTable" style="border-width:1px;border-style:solid;border-color:#ccc;margin-top: 50px"  border="1">
                    <thead>
                    <tr>
						<th>序号</th>
                        <th>主料号</th>
						<th>行号</th>
                        <th>替代料料号</th>
                        <th>状态</th>
                        <th>变更前用量</th>
                        <th>单位</th>
                        <th>变更后用量</th>
                        <th>受影响对象</th>
                        <th>编辑</th>
                    </tr>
                    </thead></table>
                <div class="table_tbody_box">
                    <table cellspacing="0" id="side10" cellpadding="0" class="rightTable1 ecoTabsTable" style="border-width:1px;border-style:solid;border-color:#ccc"  border="1">
                        <tbody>
                        <tr class="flageFirst">
                            <td class="tabNum serialNum">1</td>
                            <td><input type="text"/></td>
							<td><input type="text"/></td>
                            <td><input type="text"/></td>
                            <td><input type="text"/></td>
							<td><input type="text"/></td>
							<td><input type="text"/></td>
                            <td><input type="text"/></td>
                            <td><input type="text" placeholder=""/></td>
                            <td class="operationIcon"><i title="搜索" class="searchPage iconfont">&#xe683;</i><i title="删除" class="iconfont deleteItem">&#xe6ee;</i><i title="增加一行" class="iconfont addCuloumn">&#xe601;</i></td>
                        </tr>
                        </tbody>
                    </table>
				</div>
            </div>
            <!-- add by xucr on 20210126 添加替代料用量修改 end -->
        </div>
    </div>
</div>
<script type="text/javascript" src="../js/jquery-1.11.3.min.js"></script>
<script src="../layer/layer.js" charset="utf-8"></script>
<script type="text/javascript" src="../js/constants/formBox.js"></script>
<script type="text/javascript" src="../js/common/utils.js"></script>
<script type="text/javascript" src="../js/common/myAjax.js"></script>
<script type="text/javascript" src="../js/pages/ecotabs/toExcell.js"></script>
<script>
    (function(){
        //关闭页面
        var urlData=getQueryStringByNameTwo("single")?getQueryStringByNameTwo("single"):"";
        $("body").on("click",".closePage",function(){
            layerFn("确定要关闭此页面?",function(){
                window.location.href="about:blank";
                window.opener=null;
                window.open('','_self');
                window.close();
            })
        });
        function getIndexof(textsArr,value){
            var index;
            if(!textsArr.indexOf){
                textsArr.indexOf = function(elt /*, from*/){
                    var len = this.length >>> 0;
                    var from = Number(arguments[1]) || 0;
                    from = (from < 0)
                            ? Math.ceil(from)
                            : Math.floor(from);
                    if (from < 0)
                        from += len;
                    for (; from < len; from++)
                    {
                        if (from in this &&
                                this[from] === elt)
                            return from;
                    }
                    return -1;
                };
                index=textsArr.indexOf(value);
            }else{
                index= textsArr.indexOf(value);
            }
            return index;
        }
        var ecoidUrl =getQueryStringByNameTwo("oid")?getQueryStringByNameTwo("oid"):"";
        var numxc=getQueryStringByNameTwo("num")!==""&&getQueryStringByNameTwo("num")!==undefined?getQueryStringByNameTwo("num"):"";
        var viewxc=getQueryStringByNameTwo("view");
        var econumberxc=getQueryStringByNameTwo("econumber")!=undefined?getQueryStringByNameTwo("econumber"):""
        var datasxc="oid="+encodeURIComponent(ecoidUrl)+"&effectnumber="+encodeURIComponent(numxc)+"&view="+encodeURIComponent(viewxc)+"&econumber="+encodeURIComponent(econumberxc);
        myAjaxHistory("/tmSearchECOType",datasxc,function(result){
            if(result.result!=""&&result.result!=undefined){
                layerFn(result.result)
            }else{
                var typeArr=[];
                var dataArrs=result.datalist?result.datalist:[];
                if(dataArrs.length>0){
                    for(var i=0;i<dataArrs.length;i++){
                        typeArr.push(dataArrs[i].type);
                    }
                    var delArr=[];
                    if(typeArr.length>0){
                        for(var j=0;j<$(".tabList").length;j++){
                            var dataTypes=$(".tabList").eq(j).attr("data-type");
                            var index=getIndexof(typeArr,dataTypes);
                            if(index==(-1)){
                                $(".tabList").eq(j).removeClass("historyType")
                            }else{
                                $(".tabList").eq(j).addClass("historyType")
                            }
                         }
                        $(".historyType").eq(0).addClass("tabListChecked");
                        for(var v=0;v<$(".historyType").length;v++){
                            var dataTitle=$(".historyType").eq(v).attr("data-title");
                            $(".tab").removeClass("tabClass");
                            $("."+dataTitle).addClass("tabClass");
                            var getType=$(".historyType").eq(v).attr("data-type");
                            getHistoryData(getType,"#"+dataTitle);
                        }

                    }

                }
            }
        })
        $("tr input").attr("readonly","readonly");
        $("tr input").attr("unselectable","on");

        function isSinglePage(self){
            if(urlData!=""&&urlData!=undefined){
                var numx=getQueryStringByNameTwo("num");
                var viewx=getQueryStringByNameTwo("view")
                var valuex=numx+"("+viewx+")";
                if(numx!=""&&numx!=undefined&&valuex!=""&&valuex!=undefined){
                    $(".tab tr td:nth-last-child(2) input").val(valuex);

                }
                $(".tab tr td:nth-last-child(1) .searchPage").remove();
                $(".tab tr td:nth-last-child(1) i").css({
                    width:"50%"
                })
            }else{
            }
        }
        //isSinglePage();
        //增加一行

        //单个操作标识
        var urlData=getQueryStringByNameTwo("single");

        //存储九种变更历史数据
        var listNumArr1=[];
        var listNumArr2=[];
        var listNumArr3=[];
        var listNumArr4=[];
        var listNumArr5=[];
        var listNumArr6=[];
        var listNumArr7=[];
        var listNumArr8=[];
        var listNumArr9=[];
		var listNumArr10=[];
        //渲染历史数据
        function getHistoryData(operatetype,side){
            $("#loading").css({
                display:"block"
            });
            operatetype=operatetype?operatetype:"ADDPart";
            var type="tianMa";
            var num=getQueryStringByNameTwo("num")!==""&&getQueryStringByNameTwo("num")!==undefined?getQueryStringByNameTwo("num"):"";
            var view=getQueryStringByNameTwo("view");
            var econumber=getQueryStringByNameTwo("econumber")!=undefined?getQueryStringByNameTwo("econumber"):""
            var datas="oid="+encodeURIComponent(ecoidUrl)+"&effectnumber="+encodeURIComponent(num)+"&operatetype="+encodeURIComponent(operatetype)+"&type="+encodeURIComponent(type)+"&view="+encodeURIComponent(view)+"&econumber="+encodeURIComponent(econumber);
            myAjaxEcoHistory("/tmECODataDetail",datas,function(str){
                $("#loading").css({
                    display:"none"
                });
                if(str.result){
                    layerFn(str.result)
                }else{
                    dataLists=str.datalist
                    if(dataLists.length>0){
                        var listArr=[];
                        switch(side){
                            case "#side1":
                                for(var i=0;i<dataLists.length;i++){
                                    var listObj={};
                                    listObj.newAddNum=dataLists[i].newaddnum!=undefined?dataLists[i].newaddnum:"";
                                    listObj.state=dataLists[i].state!=undefined?dataLists[i].state:""
                                    listObj.amount=dataLists[i].amount!=undefined?dataLists[i].amount:"";
                                    listObj.unit=dataLists[i].unit!=undefined?dataLists[i].unit:"";
                                    listObj.effectnumber=dataLists[i].effectnumber+"("+dataLists[i].view+")";
                                    listArr.push(listObj);
                                }
                                listNumArr1=listArr;
                                break;
                            case "#side2":
                                for(var a=0;a<dataLists.length;a++){
                                    var listObj={};
                                    listObj.partnumber=dataLists[a].partnumber!=undefined?dataLists[a].partnumber:"";
                                    listObj.state=dataLists[a].state!=undefined?dataLists[a].state:"";
                                    listObj.amount=dataLists[a].amount!=undefined?dataLists[a].amount:"";
                                    listObj.unit=dataLists[a].unit!=undefined?dataLists[a].unit:"";
                                    listObj.linenumber=dataLists[a].linenumber!=undefined?dataLists[a].linenumber:"";
                                    listObj.effectnumber=dataLists[a].effectnumber+"("+dataLists[a].view+")";
                                    listArr.push(listObj);
                                }
                                listNumArr2=listArr
                                break;
                            case "#side3":
                                for(var b=0;b<dataLists.length;b++){
                                    var listObj={};
                                    listObj.oldnumber=dataLists[b].oldnumber!=undefined?dataLists[b].oldnumber:"";
                                    listObj.oldstate=dataLists[b].oldstate!=undefined?dataLists[b].oldstate:"";
                                    listObj.oldamount=dataLists[b].oldamount!=undefined?dataLists[b].oldamount:"";
                                    listObj.oldunit=dataLists[b].oldunit!=undefined?dataLists[b].oldunit:"";
                                    listObj.oldlinenumber=dataLists[b].oldlinenumber!=undefined?dataLists[b].oldlinenumber:"";
                                    listObj.newnumber=dataLists[b].newnumber!=undefined?dataLists[b].newnumber:"";
                                    listObj.newstate=dataLists[b].newstate!=undefined?dataLists[b].newstate:"";
                                    listObj.newamount=dataLists[b].newamount!=undefined?dataLists[b].newamount:"";
                                    listObj.newunit=dataLists[b].newunit!=undefined?dataLists[b].newunit:"";
                                    listObj.newlinenumber=dataLists[b].newlinenumber!=undefined?dataLists[b].newlinenumber:"";
                                    listObj.effectnumber=dataLists[b].effectnumber+"("+dataLists[b].view+")";
                                    listArr.push(listObj);
                                }
                                listNumArr3=listArr
                                break;
                            case "#side4":
                                for(var d=0;d<dataLists.length;d++){
                                    var listObj={};
                                    listObj.oldnumber=dataLists[d].oldnumber!=undefined?dataLists[d].oldnumber:"";
                                    listObj.oldstate=dataLists[d].oldstate!=undefined?dataLists[d].oldstate:"";
                                    listObj.oldamount=dataLists[d].oldamount!=undefined?dataLists[d].oldamount:"";
                                    listObj.oldunit=dataLists[d].oldunit!=undefined?dataLists[d].oldunit:"";
                                    listObj.oldlinenumber=dataLists[d].oldlinenumber!=undefined?dataLists[d].oldlinenumber:"";
                                    listObj.newamount=dataLists[d].newamount!=undefined?dataLists[d].newamount:"";
                                    listObj.oldunit1=dataLists[d].oldunit!=undefined?dataLists[d].oldunit:"";
                                    listObj.effectnumber=dataLists[d].effectnumber+"("+dataLists[d].view+")";
                                    listArr.push(listObj);
                                }
                                listNumArr4=listArr
                                break;
                            case "#side5":
                                for(var et=0;et<dataLists.length;et++){
                                    var listObj={};
                                    listObj.numberA=dataLists[et].numberA!=undefined?dataLists[et].numberA:"";
                                    listObj.stateA=dataLists[et].stateA!=undefined?dataLists[et].stateA:"";
                                    listObj.linenumberA=dataLists[et].linenumberA!=undefined?dataLists[et].linenumberA:"";
                                    listObj.numberB=dataLists[et].numberB!=undefined?dataLists[et].numberB:"";
                                    listObj.stateB=dataLists[et].stateB!=undefined?dataLists[et].stateB:"";
                                    listObj.amountB=dataLists[et].amountB!=undefined?dataLists[et].amountB:"";
                                    listObj.unitB=dataLists[et].unitB!=undefined?dataLists[et].unitB:"";
                                    listObj.effectnumber=dataLists[et].effectnumber+"("+dataLists[et].view+")";
                                    listArr.push(listObj);
                                }
                                listNumArr5=listArr
                                break;
                            case "#side6":
                                for(var f=0;f<dataLists.length;f++){
                                    var listObj={};
                                    listObj.numberA=dataLists[f].numberA!=undefined?dataLists[f].numberA:"";
                                    listObj.stateA=dataLists[f].stateA!=undefined?dataLists[f].stateA:"";
                                    listObj.linenumberA=dataLists[f].linenumberA!=undefined?dataLists[f].linenumberA:"";
                                    listObj.numberB=dataLists[f].numberB!=undefined?dataLists[f].numberB:"";
                                    listObj.stateB=dataLists[f].stateB!=undefined?dataLists[f].stateB:"";
                                    listObj.effectnumber=dataLists[f].effectnumber+"("+dataLists[f].view+")";
                                    listArr.push(listObj);
                                }
                                listNumArr6=listArr
                                break;
                            case "#side7":
                                for(var g=0;g<dataLists.length;g++){
                                    var listObj={};
                                    listObj.partAnumber=dataLists[g].partAnumber!=undefined?dataLists[g].partAnumber:"";
                                    listObj.partAstate=dataLists[g].partAstate!=undefined?dataLists[g].partAstate:"";
                                    listObj.partAlinenumber=dataLists[g].partAlinenumber!=undefined?dataLists[g].partAlinenumber:"";
                                    listObj.oldpartnumber=dataLists[g].oldpartnumber!=undefined?dataLists[g].oldpartnumber:"";
                                    listObj.oldstate=dataLists[g].oldstate!=undefined?dataLists[g].oldstate:"";
                                    listObj.oldpartamount=dataLists[g].oldpartamount!=undefined?dataLists[g].oldpartamount:"";
                                    listObj.oldunit=dataLists[g].oldunit!=undefined?dataLists[g].oldunit:"";
                                    listObj.newpartnumber=dataLists[g].newpartnumber!=undefined?dataLists[g].newpartnumber:"";
                                    listObj.newstate=dataLists[g].newstate!=undefined?dataLists[g].newstate:"";
                                    listObj.newpartamount=dataLists[g].newpartamount!=undefined?dataLists[g].newpartamount:"";
                                    listObj.newunit=dataLists[g].newunit!=undefined?dataLists[g].newunit:"";
                                    listObj.effectnumber=dataLists[g].effectnumber+"("+dataLists[g].view+")";
                                    listArr.push(listObj);
                                }
                                listNumArr7=listArr
                                break;
                            case "#side8":
                                for(var m=0;m<dataLists.length;m++){
                                    var listObj={};
                                    listObj.oldpartnumber=dataLists[m].oldpartnumber!=undefined?dataLists[m].oldpartnumber:"";
                                    listObj.oldstate=dataLists[m].oldstate!=undefined?dataLists[m].oldstate:"";
                                    listObj.oldpartlinenumber=dataLists[m].oldpartlinenumber!=undefined?dataLists[m].oldpartlinenumber:"";
                                    listObj.oldpartamount=dataLists[m].oldpartamount!=undefined?dataLists[m].oldpartamount:"";
                                    listObj.oldunit=dataLists[m].oldunit!=undefined?dataLists[m].oldunit:"";
                                    listObj.newpartnumber=dataLists[m].newpartnumber!=undefined?dataLists[m].newpartnumber:"";
                                    listObj.newstate=dataLists[m].newstate!=undefined?dataLists[m].newstate:"";
                                    listObj.newpartamount=dataLists[m].newpartamount!=undefined?dataLists[m].newpartamount:"";
                                    listObj.newunit=dataLists[m].newunit!=undefined?dataLists[m].newunit:"";
                                    listObj.effectnumber=dataLists[m].effectnumber+"("+dataLists[m].view+")";
                                    listArr.push(listObj);
                                }
                                listNumArr8=listArr
                                break;
                            case "#side9":
                                for(var n=0;n<dataLists.length;n++){
                                    var listObj={};
                                    listObj.partANumber=dataLists[n].partANumber!=undefined?dataLists[n].partANumber:"";
                                    listObj.stateA=dataLists[n].stateA!=undefined?dataLists[n].stateA:"";
                                    listObj.linenumber=dataLists[n].linenumber!=undefined?dataLists[n].linenumber:"";
                                    listObj.partBNumber=dataLists[n].partBNumber!=undefined?dataLists[n].partBNumber:"";
                                    listObj.stateB=dataLists[n].stateB!=undefined?dataLists[n].stateB:"";
                                    listObj.effectnumber=dataLists[n].effectnumber+"("+dataLists[n].view+")";
                                    listArr.push(listObj);
                                }
                                listNumArr9=listArr
                                break;
							//add by xucr on 20210126 添加替代料用量修改
							case "#side10":
								for(var o = 0; o < dataLists.length; o++) {
									var listObj = {};
									listObj.mainNum=dataLists[o].mainNum!=undefined?dataLists[o].mainNum:"";
									//行号
									listObj.mainLineNumber=dataLists[o].mainLineNumber!=undefined?dataLists[o].mainLineNumber:"";
                                    listObj.oldNum=dataLists[o].oldNum!=undefined?dataLists[o].oldNum:"";
                                    listObj.oldState=dataLists[o].oldState!=undefined?dataLists[o].oldState:"";
									//变更前用量、变更后用量、单位
									listObj.oldAmount=dataLists[o].oldAmount!=undefined?dataLists[o].oldAmount:"";
									listObj.unit=dataLists[o].unit!=undefined?dataLists[o].unit:"";
									listObj.newamount=dataLists[o].newAmount!=undefined?dataLists[o].newAmount:"";
                                    listObj.effectnumber=dataLists[o].effectNumber+"("+dataLists[o].view+")";
                                    listArr.push(listObj);
								}
								listNumArr10 = listArr;
								break;
                            default:;

                        }
                        var otd=$(side).find("thead tr td");
                        $(side).find("tbody tr:nth-child(1)").remove()
                        for(var j=0;j<listArr.length;j++){
                            if(j==(listArr.length-1)){
                                $(side+" tbody").append(creatTr3(listArr[j]));
                            }else{
                                if(listArr.length==1){
                                    $(side+" tbody").append(creatTr3(listArr[j]));
                                }else{
                                    $(side+" tbody").append(creatTr2(listArr[j]));
                                }

                            }

                        }
                        var $sidex=$(side+" tbody tr");
                        for(var s=0;s<$sidex.length;s++){
                            var r=s+1;
                            $(side+" tbody tr").eq(s).find("td:nth-child(1)").text(r);
                        }
                    }
                }
            })
        }
        //getHistoryData("","#side1");
        //获取tab点击对象 并获取历史数据
        $(".tabList").click(function(e){
            $(".tabList").removeClass("tabListChecked")
            tabDataTit=$(this).attr("data-title");
            var tabDataTitClass="."+tabDataTit;
            $(".tab").removeClass("tabClass");
            $(tabDataTitClass).addClass("tabClass");
            var operatetype="ADDPart";
            var dataLists=[];
          /*  switch(tabDataTit){
                case "side1":
                    if(listNumArr1.length==0){
                        operatetype="ADDPart";
                        getHistoryData(operatetype,"#side1");
                    }
                    break;
                case "side2":
                    if(listNumArr2.length==0){
                        operatetype="DelPart";
                        getHistoryData(operatetype,"#side2");
                    }

                    break;
                case "side3":
                    if(listNumArr3.length==0){
                        operatetype="ReplacePart";
                        getHistoryData(operatetype,"#side3");
                    }

                    break;
                case "side4":
                    operatetype="UpdatePart";
                    if(listNumArr4.length==0){
                        operatetype="UpdatePart";
                        getHistoryData(operatetype,"#side4");
                    }
                    break;
                case "side5":
                    operatetype="ADDReplcePart";
                    if(listNumArr5.length==0){
                        getHistoryData(operatetype,"#side5");
                    }
                    break;
                case "side6":
                    operatetype="DelReplcePart";
                    if(listNumArr6.length==0){
                        getHistoryData(operatetype,"#side6");
                    }
                    break;
                case "side7":
                    operatetype="UpdateReplcePart";
                    if(listNumArr7.length==0){
                        getHistoryData(operatetype,"#side7");
                    }
                    break;
                case "side8":
                    operatetype="updateAPart";
                    if(listNumArr8.length==0){
                        getHistoryData(operatetype,"#side8");
                    }
                    break;
                case "side9":
                    if(listNumArr9.length==0){
                        operatetype="ReplaceABPart";
                        getHistoryData(operatetype,"#side9");
                    }

                    break;
                default:;

            }
            serialNum("#"+tabDataTit);*/
            $(this).addClass("tabListChecked")
        })

        //生成序号
        function serialNum(side){
            $("tr input").attr("readonly","readonly")
            var num = side!=""&&side!=undefined?$(side+" .serialNum"):$(".serialNum");
           // $(".tab tr td input").attr("maxlength",16);
          //  $(".tab tr td:nth-last-child(2) input").attr("maxlength",25);
            for(var i = 0;i<num.length;i++){
                num[i].innerHTML=i+1;
            }
        }
        serialNum("#side1");
    })();
</script>
</body>
</html>